package com.example.cofeed.api;

import android.os.Build;
import android.text.TextUtils;
import android.view.Menu;

import com.ada.common.util.GsonUtil;
import com.blankj.utilcode.util.DeviceUtils;
import com.blankj.utilcode.util.ObjectUtils;
import com.blankj.utilcode.util.SPUtils;
import com.example.cofeed.callback.DialogCallback;
import com.example.cofeed.callback.LzyResponse;
import com.example.cofeed.constant.SputilsConstant;
import com.example.cofeed.entity.Area;
import com.example.cofeed.entity.Areas;
import com.example.cofeed.entity.Article;
import com.example.cofeed.entity.Attention;
import com.example.cofeed.entity.Catalogs;
import com.example.cofeed.entity.City;
import com.example.cofeed.entity.History;
import com.example.cofeed.entity.Home;
import com.example.cofeed.entity.IndexNumber;
import com.example.cofeed.entity.MessageNotification;
import com.example.cofeed.entity.MinTab;
import com.example.cofeed.entity.Msg;
import com.example.cofeed.entity.MsgDetails;
import com.example.cofeed.entity.Navigator;
import com.example.cofeed.entity.PayWay;
import com.example.cofeed.entity.Push;
import com.example.cofeed.entity.RegisterThird;
import com.example.cofeed.entity.Share;
import com.example.cofeed.entity.Standard;
import com.example.cofeed.entity.Subscription;
import com.example.cofeed.entity.Suoyin;
import com.example.cofeed.entity.Supply;
import com.example.cofeed.entity.User;
import com.example.cofeed.entity.VersionBean;
import com.example.cofeed.req.NavigatorGqReq;
import com.example.cofeed.req.NavigatorReq;
import com.google.gson.Gson;
import com.lzy.okgo.OkGo;

import org.apache.commons.lang3.StringEscapeUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by mqwang on 2017/11/15.
 */

public class ApiService extends BaseApi {


    public static void verifycode(Object tag, String mobile,
                                  int smstype,
                                  DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("mobile", mobile);
        params.put("smstype", smstype);

        params.put("sign", getSign(params));

        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.VERIFYCODE)
                .tag(tag)
                .upJson(jsonObject)
//                .params("mobile", mobile)
//                .params("smstype", smstype)
                .execute(callback);
    }

    /**
     * 注册
     *
     * @param tag
     * @param mobile
     * @param verifycode
     * @param password
     * @param callback
     */
    public static void register(Object tag,
                                String mobile,
                                String verifycode,
                                String password,
                                String company,
                                DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("linkman", mobile);
        params.put("verifycode", verifycode);
        params.put("password", password);
        params.put("company", company);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);

        OkGo.<LzyResponse<Object>>post(APIUrl.REGISTER)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 用户保存
     */
    public static void save_userinfo(Object tag,
                                     String picture,
                                     String name,
                                     String company,
                                     String linkman,
                                     String tel,
                                     String mobile,
                                     String address,
                                     String mainproduct,
                                     String province,
                                     String city,
                                     String area,
                                     DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("picture", picture);
        params.put("name", name);
        params.put("company", company);
        params.put("linkman", linkman);
        params.put("tel", tel);
        params.put("mobile", mobile);
        params.put("address", address);
        params.put("mainproduct", mainproduct);
        params.put("province", province);
        params.put("city", city);
        params.put("area", area);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);

        OkGo.<LzyResponse<Object>>post(APIUrl.SAVE_USERINFO)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    public static void register_first(Object tag,
                                      String mobile,
                                      DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("mobile", mobile);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);

        OkGo.<LzyResponse<Object>>post(APIUrl.REGISTER_FIRST)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 登录
     */
    public static void login(Object tag,
                             String account,
                             String password,
                             DialogCallback<LzyResponse<Map<String, String>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("username", account);
        params.put("password", password);
        String brand = Build.BRAND.toLowerCase();

        switch (brand) {
            case "huawei":
                params.put("platform", "huawei");
                params.put("deviceid", SPUtils.getInstance().getString(SputilsConstant.HUAWEI_TOKEN));
                break;
            case "xiaomi":
                params.put("platform", "mi");
                params.put("deviceid", SPUtils.getInstance().getString(SputilsConstant.XIAOMI_TOKEN));
                break;
//            case "meizu":
//                params.put("platform", "meizu");
//                params.put("deviceid", SPUtils.getInstance().getString(SputilsConstant.MEIZU_TOKEN));
//                break;
            default:
                params.put("platform", "jiguang");
                params.put("deviceid", SPUtils.getInstance().getString(SputilsConstant.DEVICE_ID));
                break;
        }

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);

        OkGo.<LzyResponse<Map<String, String>>>post(APIUrl.SMSLOGIN)
                .tag(tag)
                .upJson(jsonObject)
//                .params("account", account)
//                .params("password", password)
//                .params("deviceid", "")
                .execute(callback);
    }

    /**
     * 退出登录
     */
    public static void logout(Object tag,
                              DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SMSLOGIN_LOGOUT)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 短信退出登录
     */
    public static void sms_logout(Object tag,
                                  DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SMS_LOGOUT)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 短信自动登录
     */
    public static void sms_autologin(Object tag,
                                     DialogCallback<LzyResponse<Map<String, String>>> callback) {
        Map<String, Object> params = new HashMap<>();

        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
        if (!TextUtils.isEmpty(token)) {
            params.put("mobiletoken", token);
        }
//        params.put("deviceid", DeviceUtils.getAndroidID());

        String brand = Build.BRAND.toLowerCase();

        switch (brand) {
            case "huawei":
                params.put("platform", "huawei");
                params.put("deviceid", SPUtils.getInstance().getString(SputilsConstant.HUAWEI_TOKEN));
                break;
            case "xiaomi":
                params.put("platform", "mi");
                params.put("deviceid", SPUtils.getInstance().getString(SputilsConstant.XIAOMI_TOKEN));
                break;
            case "meizu":
                params.put("platform", "meizu");
                params.put("deviceid", SPUtils.getInstance().getString(SputilsConstant.MEIZU_TOKEN));
                break;
            default:
                params.put("platform", "jiguang");
                params.put("deviceid", SPUtils.getInstance().getString(SputilsConstant.DEVICE_ID));
                break;
        }

        params.put("sign", getSignToken(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Map<String, String>>>post(APIUrl.SMS_AUTOLOGIN)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 选择品种列表
     */
    public static void smsCatalogs(Object tag,
                                   DialogCallback<LzyResponse<Catalogs>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Catalogs>>post(APIUrl.SMS_CATALOGS)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

//    /** 关注的品种列表 */
//    public static void catalogs(Object tag,
//                                  DialogCallback<LzyResponse<List<Catalogs>>> callback){
//        Map<String, Object> params = new HashMap<>();
//
//        params.put("sign", getSign(params));
//        JSONObject jsonObject = new JSONObject(params);
//        OkGo.<LzyResponse<List<Catalogs>>>post(APIUrl.CATALOGS)
//                .tag(tag)
//                .upJson(jsonObject)
//                .execute(callback);
//    }

    /**
     *
     */
    public static void setareas(Object tag,
                                List<String> catalogs,
                                DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        Map<String, Object> params1 = new HashMap<>();
        params1.put("catalogs", new Gson().toJson(catalogs));

        params.put("sign", getSign(params1));
        params.put("catalogs", catalogs);
        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
//        if (!TextUtils.isEmpty(token)){
        params.put("accesstoken", token);
//        }
        params.put("singcode", DeviceUtils.getAndroidID());
        params.put("timestamp", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SETAREAS)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 短信列表
     */
    public static void sms(Object tag,
                           List<String> catalogs,
                           String searchdate,
                           String keyword,
                           DialogCallback<LzyResponse<Home>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("catalogs", catalogs);
        params.put("searchdate", searchdate);
        params.put("keyword", keyword);

        Map<String, Object> params1 = new HashMap<>();
        params1.put("catalogs", new Gson().toJson(catalogs));
        params1.put("searchdate", searchdate);
        params1.put("keyword", keyword);

        params.put("sign", getSignOriginal(params1));
        String token = SPUtils.getInstance().getString(SputilsConstant.AUTO_TOKEN);
//        if (!TextUtils.isEmpty(token)){
        params.put("accesstoken", token);
//        }
        params.put("singcode", DeviceUtils.getAndroidID());
        params.put("timestamp", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Home>>post(APIUrl.SMS)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 订阅推送列表
     */
    public static void pushSubscription(Object tag,
                                        DialogCallback<LzyResponse<List<Catalogs>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Catalogs>>>post(APIUrl.PUSH_SUBSCRIPTION)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }
    public static void menuUser(Object tag,
                                DialogCallback<LzyResponse<List<MinTab>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("aaa", "");
        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<MinTab>>>post(APIUrl.MENU_USER)
                .tag("ssss")
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 消息详情
     */
    public static void smsContent(Object tag,
                                  String smsid,
                                  DialogCallback<LzyResponse<MsgDetails>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("smsid", smsid);
        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<MsgDetails>>post(APIUrl.SMS_CONTENT)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 收藏
     */
    public static void favorite(
            String id,
            DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("smsid", id);

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.FAVORITE)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 删除
     */
    public static void smsDelete(
            String smsid,
            DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("smsid", smsid);
        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SMS_DELETE)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 纠错
     */
    public static void smsCorrect(Object tag,
                                  String smsid,
                                  String content,
                                  DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("smsid", smsid);
        params.put("content", content);
        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SMS_CORRECT)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 可订阅列表
     */
    public static void subscribe(Object tag,
                                 int type,
                                 DialogCallback<LzyResponse<List<Subscription>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("type", type);

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Subscription>>>post(APIUrl.SUBSCRIBE)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 可订阅城市列表
     */
    public static void subscribeCity(Object tag,
                                     int type,
                                     String catalogid,
                                     DialogCallback<LzyResponse<List<City>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("type", type);
        params.put("catalogid", catalogid);

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<City>>>post(APIUrl.SUBSCRIBE_CITY)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }



    /**
     * 订阅推送设置
     */
    public static void pushSubscriptionSet(Object tag,
                                           String cityid,
                                           int ispush,
                                           DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("cityid", cityid);
        params.put("ispush", ispush);

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.PUSH_SUBSCRIPTION_SET)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 我的消息
     */
    public static void mymsg(Object tag,
                             DialogCallback<LzyResponse<List<Msg>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Msg>>>post(APIUrl.MYMSG)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 删除消息
     */
    public static void mymsgDelete(Object tag,
                                   String msgid,
                                   DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("msgid", msgid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.MYMSG_DELETE)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 我的短信收藏列表
     */
    public static void favorite_list_favor_jiu(Object tag,
                                               DialogCallback<LzyResponse<List<Msg>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Msg>>>post(APIUrl.FAVORITE_LIST_FAVOR_JIU)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }


    /**
     * 我的文章收藏列表
     */
    public static void favoriteListFavor(Object tag,
                                         DialogCallback<LzyResponse<List<History>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<History>>>post(APIUrl.FAVORITE_LIST_FAVOR)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 生成支付订单
     */
    public static void orders(Object tag,
                              String buyid,
                              List<Areas> areas,
                              DialogCallback<LzyResponse<Map<String, String>>> callback) {
        Map<String, Object> params = new HashMap<>();
//        params.put("buyid", buyid);


        JSONArray jsonArray = new JSONArray();
//        Map<String, String> hashMap = new HashMap<>();

        for (Areas areas1 : areas) {
            JSONObject jsonObject = new JSONObject();
            try {
//                hashMap.put("catalogid", areas1.catalogid);
//                hashMap.put("cityid", areas1.cityid);
//                hashMap.put("buytime", areas1.buytime);

                jsonObject.put("catalogid", areas1.catalogid);
                jsonObject.put("cityid", areas1.cityid);
                jsonObject.put("buytime", areas1.buytime);
                jsonArray.put(jsonObject);

            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
//        params.put("areas", hashMap);


        Map<String, Object> params1 = new HashMap<>();
        params1.put("areas", jsonArray);
//        params1.put("buyid", buyid);

        params.put("sign", getSignOriginal(params1));
        String token = SPUtils.getInstance().getString(SputilsConstant.AUTO_TOKEN);
//        if (!TextUtils.isEmpty(token)){
        params.put("accesstoken", token);
//        }
        params.put("singcode", DeviceUtils.getAndroidID());
        params.put("timestamp", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        JSONObject jsonObject = new JSONObject(params);
        try {
            jsonObject.put("areas", jsonArray);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        OkGo.<LzyResponse<Map<String, String>>>post(APIUrl.ORDERS)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 我的订阅
     */
    public static void my_subscription(Object tag,
                                       DialogCallback<LzyResponse<List<Catalogs>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Catalogs>>>post(APIUrl.MY_SUBSCRIPTION)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 加入订阅接口
     */
    public static void cartAdd(Object tag,
                               String catalogid,
                               String cityid,
                               int selected,
                               DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("catalogid", catalogid);
        params.put("cityid", cityid);
        params.put("selected", selected);

        params.put("sign", getSignOriginal(params));

        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.CART_ADD)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 购物车列表
     */
    public static void cart(Object tag,
                            DialogCallback<LzyResponse<List<Catalogs>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Catalogs>>>post(APIUrl.CART)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 用户找回密码
     */
    public static void passwordGetBack(Object tag,
                                       String mobile,
                                       String verifycode,
                                       String password,
                                       DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("mobile", mobile);
        params.put("verifycode", verifycode);
        params.put("password", password);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.PASSWORD_GET_BACK)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 用户中心菜单
     */
    public static void otherGetUserMenu(Object tag,
                                        DialogCallback<LzyResponse<List<Menu>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Menu>>>post(APIUrl.OTHER_GET_USER_MENU)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 设置菜单
     */
    public static void otherGetConfigMenu(Object tag,
                                          DialogCallback<LzyResponse<List<Menu>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Menu>>>post(APIUrl.OTHER_GET_CONFIG_MENU)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 支付方式列表
     */
    public static void payment(Object tag,
                               DialogCallback<LzyResponse<PayWay>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<PayWay>>post(APIUrl.PAYMENT)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 请求支付串
     */
    public static void paymentGetPaymentInfo(Object tag,
                                             String orderno,
                                             String paytype,
                                             DialogCallback<LzyResponse<Map<String, String>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("orderno", orderno);
        params.put("paytype", paytype);

        params.put("sign", getSignOriginal(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Map<String, String>>>post(APIUrl.PAYMENT_GET_PAYMENT_INFO)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 收藏删除
     */
    public static void favoriteDelete(
            String smsid,
            DialogCallback<LzyResponse<Map<String, String>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("smsid", smsid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Map<String, String>>>post(APIUrl.FAVORITE_DELETE)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 版本号
     */
    public static void version(String version,
                               DialogCallback<LzyResponse<VersionBean>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("version", version);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<VersionBean>>post(APIUrl.VERSION)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 整合接口，首页
     */
    public static void dataset_homepage(Object object,
                                        Map<String, Object> ad_param,
                                        Map<String, Object> article_list_param,
                                        Map<String, Object> rcm_param,
                                        DialogCallback<LzyResponse<Home>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("ad_param", ad_param);
        params.put("article_list_param", article_list_param);
        params.put("rcm_param", rcm_param);


        Map<String, Object> params1 = new HashMap<>();
        params1.put("ad_param", GsonUtil.toJson(ad_param));
        params1.put("article_list_param", GsonUtil.toJson(article_list_param));
        params1.put("rcm_param", GsonUtil.toJson(rcm_param));

        String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());

        params.put("sign", getSign(params1, date));

        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
        if (!TextUtils.isEmpty(token)) {
            params.put("accesstoken", token);
        }
        params.put("signcode", DeviceUtils.getAndroidID());
        params.put("timestamp", date);

        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Home>>post(APIUrl.DATASET_HOMEPAGE)
                .upJson(jsonObject)
                .tag(object)
                .execute(callback);
    }

    /**
     * 整合接口，首页-关注
     */
    public static void dataset_follow(Object object,
                                      String refresh,
//                                      Map<String, Object> rcm_param,
                                      Map<String, Object> follow_param,
                                      DialogCallback<LzyResponse<Home>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("refresh", refresh);
//        params.put("rcm_param", rcm_param);
        params.put("follow_param", follow_param);


        Map<String, Object> params1 = new HashMap<>();
        params1.put("refresh", refresh);
//        params1.put("rcm_param", GsonUtil.toJson(rcm_param));
        params1.put("follow_param", GsonUtil.toJson(follow_param));

        params.put("sign", getSign(params1));

        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
        if (!TextUtils.isEmpty(token)) {
            params.put("accesstoken", token);
        }
        params.put("signcode", DeviceUtils.getAndroidID());
        params.put("timestamp", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));

        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Home>>post(APIUrl.DATASET_FOLLOW)
                .upJson(jsonObject)
                .tag(object)
                .execute(callback);
    }


    /**
     * 整合接口，首页-推荐
     */
    public static void dataset_recommend(Object tag, int page, String refresh,
                                         DialogCallback<LzyResponse<Home>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("page", page);
        if (ObjectUtils.isNotEmpty(refresh)) {
            params.put("refresh", refresh);
        }

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Home>>post(APIUrl.DATASET_RECOMMEND)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 搜索
     */
    public static void searcher(Object tag, String keyword, int page,
                                DialogCallback<LzyResponse<List<Article>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("keyword", keyword);
        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Article>>>post(APIUrl.SEARCHER)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 搜索SEARCH_V2
     */
    public static void search_v2(Object tag, String keyword, int page,
                                 DialogCallback<LzyResponse<List<Article>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("keyword", keyword);
        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Article>>>post(APIUrl.SEARCH_V2)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 搜索SEARCH_GET_WORDS
     */
    public static void search_get_words(Object tag, String keyword,
                                        DialogCallback<LzyResponse<List<Suoyin>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("keyword", keyword);
//        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Suoyin>>>post(APIUrl.SEARCH_GET_WORDS)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 搜索SEARCH_HOTWORDS
     */
    public static void search_hotwords(Object tag,
                                       DialogCallback<LzyResponse<List<Suoyin>>> callback) {
        Map<String, Object> params = new HashMap<>();

//        params.put("keyword", keyword);
//        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Suoyin>>>post(APIUrl.SEARCH_HOTWORDS)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * NAVIGATOR_GET_AREAS
     */
    public static void navigator_get_areas(Object tag, int catid, int chid,
                                           DialogCallback<LzyResponse<List<Area>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("catid", catid);
        params.put("chid", chid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Area>>>post(APIUrl.NAVIGATOR_GET_AREAS)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 导航栏
     */
    public static void navigator_index(Object tag,
                                       DialogCallback<LzyResponse<ArrayList<Navigator>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<ArrayList<Navigator>>>post(APIUrl.NAVIGATOR_GET_LIST)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 获取全部导航的品种
     */
    public static void navigator_get_all(Object tag,
                                         DialogCallback<LzyResponse<Navigator>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Navigator>>post(APIUrl.NAVIGATOR_GET_ALL)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 点击对应导航数据接口
     */
    public static void navigator_subnav(Object tag, int catid, int chid,
                                        DialogCallback<LzyResponse<List<Navigator>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("catid", catid);
        params.put("chid", chid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Navigator>>>post(APIUrl.NAVIGATOR_SUBNAV)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 供求导航条接口
     */
    public static void navigator_supply(Object tag,
                                        DialogCallback<LzyResponse<List<Navigator>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Navigator>>>post(APIUrl.NAVIGATOR_SUPPLY)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }


    /**
     *
     */
    public static void register_catalogs(Object tag,
                                         DialogCallback<LzyResponse<List<Navigator>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Navigator>>>post(APIUrl.REGISTER_CATALOGS)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 自定义与初始化供求导航条合并接口
     */
    public static void navigator_supply_nav(Object tag,
                                            DialogCallback<LzyResponse<List<Navigator>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Navigator>>>post(APIUrl.NAVIGATOR_SUPPLY_NAV)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 供求品种的规格
     */
    public static void navigator_supply_get_standard(Object tag, int catid,
                                                     DialogCallback<LzyResponse<List<Standard>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("catid", catid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Standard>>>post(APIUrl.NAVIGATOR_SUPPLY_GET_STANDARD)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 供求列表
     */
    public static void supply_get_list(Object tag, int page,
                                       int stype,//供求类型，0全部、1供应、2求购、3招商
                                       int catid,
                                       String keyword,
                                       DialogCallback<LzyResponse<List<Supply>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);
        params.put("stype", stype);
        params.put("catid", catid);
        if (ObjectUtils.isNotEmpty(keyword)) {
            params.put("keyword", keyword);
        }
        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Supply>>>post(APIUrl.SUPPLY_GET_LIST)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 我的供求列表
     */
    public static void supply_get_user_list(Object tag, int page,
                                            DialogCallback<LzyResponse<List<Supply>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Supply>>>post(APIUrl.SUPPLY_GET_USER_LIST)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 供求列表
     */
    public static void supply_edit(Object tag, int id,
                                   DialogCallback<LzyResponse<Supply>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Supply>>post(APIUrl.SUPPLY_EDIT)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 文件上传
     */
    public static void uploader(Object tag, File file,
                                DialogCallback<LzyResponse<Map<String, String>>> callback) {
        Map<String, Object> params = new HashMap<>();
        List<File> fileList = new ArrayList<>();
        fileList.add(file);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Map<String, String>>>post(APIUrl.UPLOADER)
//                .upJson(jsonObject)
                .tag(tag)
                .addFileParams("userfile", fileList)
//                .upFile(file)
                .execute(callback);
    }

    /**
     * 供求保存
     */
    public static void supply_save(Object tag, String title,
                                   String content,
                                   int catid,
                                   int id,
                                   List<String> imgsrc,
                                   String company,
                                   String material,
                                   String number,
                                   String linkman,
                                   String tel,
                                   String product,
                                   int stype,
                                   String price,
                                   String pick_place,
                                   DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("title", title);
        params.put("content", content);
        params.put("catalogids", catid);
        params.put("id", id);
        params.put("imgsrc", imgsrc);
        params.put("company", company);
        params.put("material", material);
        params.put("number", number);
        params.put("linkman", linkman);
        params.put("tel", tel);
        params.put("product", product);
        params.put("stype", stype);
        params.put("price", price);
        params.put("pick_place", pick_place);

        Map<String, Object> params1 = new HashMap<>();
        params1.put("title", title);
        params1.put("content", content);
        params1.put("catalogids", catid);
        params1.put("id", id);
//        List<String> imgs = new ArrayList<>();

        JSONArray jsonArray = new JSONArray();
        for (String s : imgsrc) {
            jsonArray.put(s);
//            if (s.contains("/")){
//                String test = s.replace("/", "\\/");
//                imgs.add(test);
////                imgs.add(s.replace("/", "\\/"));
//                s.replace("/", "\\/");
//            }
        }

        String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
//        StringEscapeUtils
//        params1.put("imgsrc", StringEscapeUtils.unescapeJson(new Gson().toJson(imgs)));
        params1.put("imgsrc", jsonArray);
        params1.put("company", company);
        params1.put("material", material);
        params1.put("number", number);
        params1.put("linkman", linkman);
        params1.put("tel", tel);
        params1.put("product", product);
        params1.put("stype", stype);
        params1.put("price", price);
        params1.put("pick_place", pick_place);

        params.put("sign", getSign(params1, time));

        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
        if (!TextUtils.isEmpty(token)) {
            params.put("accesstoken", token);
        }
        params.put("signcode", DeviceUtils.getAndroidID());
        params.put("timestamp", time);


        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SUPPLY_SAVE)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 意见反馈
     */
    public static void suggestion_add(Object tag, int type,//搜索，查找商品，商品发现  1 支付问题  2 客服问题 3 会员相关 4 售后、订单相关 5 其他 6
                                      String content,
                                      DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("type", type);
        params.put("content", content);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SUGGESTION_ADD)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 浏览记录接口
     */
    public static void logview_article(Object tag,
                                       DialogCallback<LzyResponse<List<History>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<History>>>post(APIUrl.LOGVIEW_ARTICLE)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 浏览记录清除接口
     */
    public static void logview_delete_article(Object tag, String target,
                                              DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("target", target);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.LOGVIEW_DELETE_ARTICLE)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 用户自定义导航-保存
     */
    public static void navigator_add_custom(Object tag, List<Navigator> navlist,
                                            DialogCallback<LzyResponse<Object>> callback) {

        Map<String, Object> params = new HashMap<>();

        List<NavigatorReq> navigatorReqs = new ArrayList<>();

        JSONArray jsonArray = new JSONArray();
        JSONArray jsonArray1 = new JSONArray();
        for (Navigator navigator : navlist) {
            NavigatorReq req = new NavigatorReq();
//            req.navid = navigator.id;
            req.catid = navigator.catid;
            req.chid = navigator.chid;
//            req.title = navigator.title;
//            req.title = stringToUnicode(navigator.title);
            navigatorReqs.add(req);

            JSONObject jsonObject = new JSONObject();
            JSONObject jsonObject1 = new JSONObject();
            try {
//                jsonObject.put("navid", navigator.id);
                jsonObject.put("catid", navigator.catid);
                jsonObject.put("chid", navigator.chid);
//                String title = stringToUnicode(navigator.title).replace("\\\\", "\\");

//                jsonObject.put("title", stringToUnicode(navigator.title));
//                jsonObject.put("title", title);
                jsonArray.put(jsonObject);

//                jsonObject1.put("navid", navigator.id);
                jsonObject1.put("catid", navigator.catid);
                jsonObject1.put("chid", navigator.chid);
//                jsonObject1.put("title", navigator.title);
                jsonArray1.put(jsonObject1);

            } catch (JSONException e) {
                e.printStackTrace();
            }

        }

        Map<String, Object> params1 = new HashMap<>();
//        params1.put("navlist", navigatorReqs);
        params1.put("navlist", StringEscapeUtils.unescapeJson(new Gson().toJson(navigatorReqs)));
//        params1.put("navlist", jsonArray);

        String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());


        params.put("sign", getSign(params1, time));
//        params.put("navlist", new Gson().toJson(navigatorReqs));
        params.put("navlist", jsonArray1);
//        params.put("navlist", navigatorReqs);
        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
//        if (!TextUtils.isEmpty(token)){
        params.put("accesstoken", token);
//        }
        params.put("signcode", DeviceUtils.getAndroidID());
        params.put("timestamp", time);


        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.NAVIGATOR_ADD_CUSTOM)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 供求用户自定义导航-保存
     */
    public static void navigator_save_supply_custom(Object tag, List<Navigator> navlist,
                                                    DialogCallback<LzyResponse<Object>> callback) {

//        Map<String, Object> params = new HashMap<>();
//
//        List<NavigatorGqReq> navigatorReqs = new ArrayList<>();
//
//        JSONArray jsonArray = new JSONArray();
//        JSONArray jsonArray1 = new JSONArray();
//        for (Navigator navigator:navlist){
//            NavigatorGqReq req = new NavigatorGqReq();
////            req.navid = navigator.id;
//            req.catid = navigator.catid;
////            req.chid = navigator.chid;
////            req.title = navigator.title;
////            req.title = stringToUnicode(navigator.title);
//
//            navigatorReqs.add(req);
//
//            JSONObject jsonObject = new JSONObject();
//            JSONObject jsonObject1 = new JSONObject();
//            try {
////                jsonObject.put("navid", navigator.id);
//                jsonObject.put("catid", navigator.catid);
////                jsonObject.put("chid", navigator.chid);
////                String title = stringToUnicode(navigator.title).replace("\\\\", "\\");
//
////                jsonObject.put("title", stringToUnicode(navigator.title));
////                jsonObject.put("title", title);
//                jsonArray.put(jsonObject);
//
////                jsonObject1.put("navid", navigator.id);
//                jsonObject1.put("catid", navigator.catid);
////                jsonObject1.put("chid", navigator.chid);
////                jsonObject1.put("title", navigator.title);
//                jsonArray1.put(jsonObject1);
//
//            } catch (JSONException e) {
//                e.printStackTrace();
//            }
//
//        }
//
//        Map<String, Object> params1 = new HashMap<>();
////        params1.put("navlist", navigatorReqs);
//        params1.put("navlist", StringEscapeUtils.unescapeJson(new Gson().toJson(navigatorReqs)));
////        params1.put("navlist", jsonArray);
//
//        String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
//
//
//        params.put("sign", getSign(params1, time));
////        params.put("navlist", new Gson().toJson(navigatorReqs));
//        params.put("navlist", jsonArray1);
////        params.put("navlist", navigatorReqs);
//        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
////        if (!TextUtils.isEmpty(token)){
//        params.put("accesstoken", token);
////        }
//        params.put("signcode", DeviceUtils.getAndroidID());
//        params.put("timestamp", time);


        Map<String, Object> params = new HashMap<>();

        List<NavigatorGqReq> navigatorReqs = new ArrayList<>();

        JSONArray jsonArray = new JSONArray();
        JSONArray jsonArray1 = new JSONArray();
        for (Navigator navigator : navlist) {
            NavigatorGqReq req = new NavigatorGqReq();
//            req.navid = navigator.id;
            req.catid = navigator.catid;
//            req.chid = navigator.chid;
//            req.title = navigator.title;
//            req.title = stringToUnicode(navigator.title);
            navigatorReqs.add(req);

            JSONObject jsonObject = new JSONObject();
            JSONObject jsonObject1 = new JSONObject();
            try {
//                jsonObject.put("navid", navigator.id);
                jsonObject.put("catid", navigator.catid);
//                jsonObject.put("chid", navigator.chid);
//                String title = stringToUnicode(navigator.title).replace("\\\\", "\\");

//                jsonObject.put("title", stringToUnicode(navigator.title));
//                jsonObject.put("title", title);
                jsonArray.put(jsonObject);

//                jsonObject1.put("navid", navigator.id);
                jsonObject1.put("catid", navigator.catid);
//                jsonObject1.put("chid", navigator.chid);
//                jsonObject1.put("title", navigator.title);
                jsonArray1.put(jsonObject1);

            } catch (JSONException e) {
                e.printStackTrace();
            }

        }

        Map<String, Object> params1 = new HashMap<>();
//        params1.put("navlist", navigatorReqs);
        params1.put("navlist", StringEscapeUtils.unescapeJson(new Gson().toJson(navigatorReqs)));
//        params1.put("navlist", jsonArray);

        String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());


        params.put("sign", getSign(params1, time));
//        params.put("navlist", new Gson().toJson(navigatorReqs));
        params.put("navlist", jsonArray1);
//        params.put("navlist", navigatorReqs);
        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
//        if (!TextUtils.isEmpty(token)){
        params.put("accesstoken", token);
//        }
        params.put("signcode", DeviceUtils.getAndroidID());
        params.put("timestamp", time);


        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.NAVIGATOR_SAVE_SUPPLY_CUSTOM)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }


    /**
     * 供求置顶
     */
    public static void supply_refresh(Object tag, int id,
                                      DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("id", id);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SUPPLY_REFRESH)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 获取用户姓名头像接口
     */
    public static void userinfo_picname(Object tag,
                                        DialogCallback<LzyResponse<Map<String, String>>> callback) {
        Map<String, Object> params = new HashMap<>();


        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Map<String, String>>>post(APIUrl.USERINFO_PICNAME)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 获取用户资料接口
     */
    public static void userinfo_get_edit(Object tag,
                                         DialogCallback<LzyResponse<List<User>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<User>>>post(APIUrl.USERINFO_GET_EDIT)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 获取客服电话
     */
    public static void service_phone(Object tag,
                                     DialogCallback<LzyResponse<Map<String, String>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Map<String, String>>>post(APIUrl.SERVICE_PHONE)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 短信在线订阅状态查询
     */
    public static void is_subscribe(Object tag,
                                    DialogCallback<LzyResponse<Map<String, Integer>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Map<String, Integer>>>post(APIUrl.IS_SUBSCRIBE)
                .upJson(jsonObject)
                .tag(tag)
                .execute(callback);
    }

    /**
     * 我的关注
     */
    public static void get_followinfo(Object tag,
                                      DialogCallback<LzyResponse<List<Attention>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Attention>>>post(APIUrl.GET_FOLLOWINFO)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 我的关注开关
     */
    public static void followinfo_on_off(Object tag, int ispush, int catid, int chid,
                                         DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("ispush", ispush);
        params.put("catid", catid);
        params.put("chid", chid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.FOLLOWINFO_ON_OFF)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 消息菜单接口
     */
    public static void menu_message(Object tag,
                                    DialogCallback<LzyResponse<List<MessageNotification>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<MessageNotification>>>post(APIUrl.MENU_MESSAGE)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 系统消息
     */
    public static void message_sysmsg(Object tag, int page,
                                      DialogCallback<LzyResponse<List<MessageNotification>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<MessageNotification>>>post(APIUrl.MESSAGE_SYSMSG)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 用户评价列表
     */
    public static void comment_user(Object tag, int page,
                                    DialogCallback<LzyResponse<List<MessageNotification>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<MessageNotification>>>post(APIUrl.COMMENT_USER)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 咨询消息列表
     */
    public static void message_supply(Object tag, int page,
                                      DialogCallback<LzyResponse<List<MessageNotification>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<MessageNotification>>>post(APIUrl.MESSAGE_SUPPLY)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 商机消息列表
     */
    public static void message_business(Object tag, int page,
                                        DialogCallback<LzyResponse<List<MessageNotification>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("page", page);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<MessageNotification>>>post(APIUrl.MESSAGE_BUSINESS)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 供求咨询回复
     */
    public static void supply_asking_reply(Object tag, int id, String content,
                                           DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("id", id);
        params.put("content", content);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.SUPPLY_ASKING_REPLY)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 指数接口
     */
    public static void index_number(Object tag,
                                    DialogCallback<LzyResponse<List<IndexNumber>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<IndexNumber>>>post(APIUrl.INDEX_NUMBER)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 一级关注列表接口
     */
    public static void followinfo_followlist(Object tag,
                                             DialogCallback<LzyResponse<List<Attention>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Attention>>>post(APIUrl.FOLLOWINFO_FOLLOWLIST)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }


    /**
     * 二级关注列表接口
     */
    public static void followinfo_subfollowlist(Object tag, int id,
                                                DialogCallback<LzyResponse<List<Attention>>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("catid", id);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Attention>>>post(APIUrl.FOLLOWINFO_SUBFOLLOWLIST)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 添加关注
     */
    public static void followinfo_add(Object tag, int catid, int chid, int areaid,
                                      DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("catid", catid);
        params.put("chid", chid);
        params.put("areaid", areaid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.FOLLOWINFO_ADD)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 推送设置选项列表
     */
    public static void push_list_options(Object tag,
                                         DialogCallback<LzyResponse<List<Push>>> callback) {
        Map<String, Object> params = new HashMap<>();

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<List<Push>>>post(APIUrl.PUSH_LIST_OPTIONS)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 推送设置
     */
    public static void push_set(Object tag, int optionid, int ispush,
                                DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("optionid", optionid);
        params.put("ispush", ispush);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.PUSH_SET)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 注册三
     */
    public static void register_third(Object tag, List<Integer> catalogs,
                                      DialogCallback<LzyResponse<RegisterThird>> callback) {
        Map<String, Object> params = new HashMap<>();

        Map<String, Object> params1 = new HashMap<>();
        params1.put("catalogs", new Gson().toJson(catalogs));

        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        params.put("sign", getSign(params1, format));
        params.put("catalogs", catalogs);
        String token = SPUtils.getInstance().getString(SputilsConstant.TOKEN);
//        if (!TextUtils.isEmpty(token)){
        params.put("accesstoken", token);
//        }
        params.put("signcode", DeviceUtils.getAndroidID());
        params.put("timestamp", format);
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<RegisterThird>>post(APIUrl.REGISTER_THIRD)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }


    /**
     * 密码，校验手机是否绑定账号
     */
    public static void password_mobile_status(Object tag, String mobile,
                                              DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("mobile", mobile);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.PASSWORD_MOBILE_STATUS)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }


    /**
     * 密码，校验账号是否绑定手机
     */
    public static void password_account_status(Object tag,
                                               DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
//        params.put("optionid", optionid);
//        params.put("ispush", ispush);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.PASSWORD_ACCOUNT_STATUS)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }


    /**
     * 【密码，绑定手机】
     */
    public static void password_bind_mobile(Object tag, String mobile, String verifycode,
                                            DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("mobile", mobile);
        params.put("verifycode", verifycode);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.PASSWORD_BIND_MOBILE)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }


    /**
     * 【密码，校验】
     */
    public static void password_check(Object tag, String password, int accountid, String verifycode,
                                      DialogCallback<LzyResponse<Object>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("password", password);
        params.put("accountid", accountid);
        params.put("verifycode", verifycode);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Object>>post(APIUrl.PASSWORD_CHECK)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }


    /**
     * 分享
     */
    public static void article_share(Object tag, int infoid,
                                     DialogCallback<LzyResponse<Share>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("infoid", infoid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Share>>post(APIUrl.ARTICLE_SHARE)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

    /**
     * 分享
     */
    public static void supply_share(Object tag, int infoid,
                                    DialogCallback<LzyResponse<Share>> callback) {
        Map<String, Object> params = new HashMap<>();
        params.put("supplyid", infoid);

        params.put("sign", getSign(params));
        JSONObject jsonObject = new JSONObject(params);
        OkGo.<LzyResponse<Share>>post(APIUrl.SUPPLY_SHARE)
                .tag(tag)
                .upJson(jsonObject)
                .execute(callback);
    }

}
